n=608; m=1000; q=3; belt=[|137,136| 533,432| 281,503| 18,508| 83,331| 168,209| 40,256| 227,467| 451,323| 381,449| 181,9| 242,567| 497,543| 295,425| 181,393| 217,312| 503,415| 390,236| 339,598| 388,87| 355,373| 167,160| 112,92| 588,319| 146,339| 40,369| 216,501| 163,318| 213,202| 432,289| 375,8| 128,608| 442,233| 562,372| 129,20| 461,342| 527,341| 437,451| 445,2| 203,297| 25,558| 383,8| 131,434| 352,228| 247,184| 420,61| 4,216| 127,416| 581,398| 555,486| 115,560| 235,459| 69,550| 554,399| 163,383| 85,351| 294,401| 203,274| 42,158| 22,404| 489,455| 179,99| 580,474| 335,178| 259,113| 352,333| 200,519| 123,189| 555,484| 552,352| 588,90| 323,88| 15,487| 492,231| 403,39| 606,396| 146,268| 155,466| 504,571| 537,144| 499,122| 33,418| 30,530| 106,323| 308,150| 569,320| 60,376| 111,315| 241,432| 353,385| 387,474| 27,476| 333,429| 219,564| 187,306| 87,209| 43,420| 243,155| 515,315| 256,57| 424,215| 380,41| 511,443| 70,314| 604,539| 10,196| 238,533| 277,394| 300,230| 289,563| 592,258| 602,542| 378,519| 68,544| 153,132| 459,373| 232,517| 102,148| 447,592| 414,112| 101,558| 343,215| 554,304| 46,469| 377,445| 360,205| 270,408| 560,374| 443,410| 325,222| 127,572| 14,606| 477,537| 88,526| 31,399| 237,464| 116,362| 246,76| 359,343| 284,487| 382,407| 474,78| 189,543| 520,34| 297,372| 20,8| 164,431| 588,239| 265,423| 513,405| 253,182| 383,283| 297,399| 161,606| 169,401| 299,210| 39,592| 261,413| 401,472| 362,282| 286,520| 580,599| 473,449| 387,434| 97,564| 605,157| 18,80| 497,198| 371,600| 224,470| 528,531| 481,5| 125,300| 459,143| 524,11| 283,162| 508,300| 570,41| 223,82| 208,248| 132,127| 407,500| 370,531| 188,52| 204,556| 148,288| 426,373| 244,126| 557,159| 176,524| 586,90| 201,432| 184,371| 335,599| 187,570| 55,490| 32,394| 335,196| 585,408| 318,333| 250,24| 64,189| 22,172| 34,288| 479,179| 489,368| 162,250| 29,260| 550,464| 44,336| 6,252| 571,442| 595,500| 200,237| 157,199| 226,586| 554,379| 467,359| 240,104| 520,40| 396,38| 268,180| 157,387| 213,440| 51,192| 591,168| 260,452| 244,95| 266,332| 487,30| 81,276| 164,246| 429,583| 278,450| 333,71| 307,378| 239,422| 433,44| 40,299| 270,534| 203,327| 105,519| 181,295| 389,432| 439,574| 433,461| 98,480| 458,514| 43,464| 83,579| 311,395| 447,600| 591,5| 86,124| 331,451| 94,486| 158,238| 285,518| 114,534| 215,178| 240,230| 313,504| 377,594| 546,238| 49,545| 203,10| 333,490| 449,228| 74,454| 302,68| 449,360| 368,15| 412,292| 352,584| 396,286| 57,495| 388,406| 230,205| 118,345| 194,408| 368,279| 431,25| 154,556| 405,273| 238,339| 214,428| 135,155| 543,198| 551,187| 131,281| 311,532| 578,283| 61,5| 459,337| 347,449| 226,41| 560,6| 398,88| 345,492| 257,291| 48,60| 13,95| 539,265| 337,410| 410,576| 583,433| 399,187| 314,1| 388,283| 79,143| 172,147| 353,342| 574,402| 63,181| 338,66| 134,158| 589,583| 412,455| 166,305| 587,153| 597,2| 308,483| 513,448| 514,85| 512,226| 218,409| 325,270| 324,43| 337,607| 1,487| 462,178| 185,98| 418,371| 410,270| 353,398| 75,171| 144,498| 429,31| 298,119| 467,215| 21,48| 517,491| 123,320| 490,208| 597,276| 524,225| 542,7| 560,507| 446,327| 383,458| 85,361| 560,72| 48,434| 255,303| 449,411| 15,581| 79,370| 152,354| 167,216| 349,244| 522,443| 116,435| 376,544| 240,586| 119,143| 47,456| 273,59| 369,376| 522,54| 487,25| 20,242| 15,547| 313,268| 187,558| 185,152| 31,317| 592,275| 376,583| 607,126| 520,352| 283,49| 594,421| 98,194| 68,190| 440,102| 85,179| 326,67| 521,577| 558,138| 193,332| 516,370| 115,89| 319,416| 501,472| 307,450| 539,382| 129,401| 124,401| 110,487| 595,162| 4,241| 440,227| 319,587| 564,396| 347,118| 399,424| 352,20| 428,212| 295,459| 358,23| 20,455| 474,320| 201,409| 220,63| 42,53| 92,130| 138,592| 323,589| 301,321| 208,498| 313,281| 231,438| 504,352| 483,283| 59,476| 23,252| 385,565| 223,463| 102,595| 465,102| 142,125| 449,548| 305,338| 587,592| 328,445| 89,11| 329,586| 526,130| 413,484| 218,353| 222,59| 436,307| 96,540| 97,264| 197,552| 69,586| 99,3| 604,364| 561,466| 285,506| 542,549| 516,397| 352,448| 516,238| 76,113| 264,471| 148,332| 198,528| 108,463| 415,422| 335,541| 31,28| 49,239| 578,582| 116,423| 431,423| 516,203| 43,15| 447,77| 529,157| 40,398| 235,409| 471,319| 210,476| 553,538| 152,178| 249,205| 270,177| 219,2| 506,291| 156,484| 427,369| 544,476| 463,87| 407,393| 81,590| 76,132| 291,188| 389,410| 469,545| 34,480| 247,574| 75,148| 462,304| 70,459| 578,501| 432,32| 608,162| 377,242| 300,535| 343,598| 416,376| 312,417| 151,331| 337,519| 474,506| 493,150| 200,198| 152,515| 406,206| 458,100| 161,92| 138,210| 48,70| 371,414| 419,520| 447,98| 231,407| 134,479| 147,171| 5,387| 538,468| 20,525| 381,234| 370,565| 586,59| 202,336| 230,45| 309,119| 499,371| 552,104| 448,421| 98,485| 349,575| 165,560| 501,8| 547,371| 501,596| 521,23| 417,480| 318,303| 406,87| 353,151| 29,73| 391,586| 128,181| 189,118| 86,473| 62,345| 452,219| 167,387| 557,397| 147,452| 402,437| 220,385| 226,97| 250,452| 532,24| 467,543| 129,180| 384,294| 478,559| 444,230| 198,500| 476,183| 220,291| 379,311| 592,296| 434,263| 72,184| 20,466| 159,430| 311,504| 140,420| 181,74| 538,5| 344,116| 604,58| 60,432| 198,137| 110,264| 56,495| 387,127| 244,583| 445,350| 501,497| 426,9| 115,272| 558,379| 212,515| 592,113| 318,107| 183,191| 262,21| 322,556| 269,550| 150,301| 47,446| 238,306| 369,175| 94,323| 511,335| 451,174| 518,540| 309,154| 57,358| 68,402| 426,305| 206,422| 263,535| 408,316| 517,275| 328,382| 248,261| 148,498| 296,568| 519,55| 72,30| 53,198| 204,263| 198,585| 416,301| 123,14| 414,65| 391,274| 522,442| 441,438| 256,365| 510,310| 330,30| 316,459| 102,484| 545,51| 170,87| 196,62| 149,453| 238,284| 583,271| 20,348| 442,344| 472,26| 361,488| 371,575| 114,304| 306,594| 414,136| 513,470| 25,390| 425,482| 77,169| 369,383| 510,134| 475,468| 52,483| 487,345| 504,592| 437,383| 183,279| 400,467| 447,254| 158,392| 394,231| 80,261| 86,94| 227,274| 212,152| 415,175| 239,101| 102,68| 385,208| 89,93| 134,8| 554,12| 518,525| 511,67| 494,462| 445,351| 214,171| 496,268| 559,175| 556,208| 240,231| 539,105| 522,48| 436,118| 371,160| 91,491| 375,422| 499,517| 453,281| 567,498| 308,578| 42,298| 226,273| 217,520| 356,536| 268,209| 375,271| 244,355| 442,32| 130,547| 136,549| 605,228| 391,33| 204,334| 351,260| 328,262| 373,407| 148,308| 198,76| 222,534| 522,448| 320,18| 519,512| 486,591| 246,259| 495,40| 409,309| 308,213| 394,398| 8,288| 54,81| 573,358| 83,587| 568,338| 421,459| 332,54| 530,192| 164,111| 346,121| 359,431| 462,234| 438,305| 603,213| 583,460| 597,173| 424,219| 281,366| 580,68| 4,262| 380,53| 296,237| 586,247| 518,477| 365,320| 68,374| 191,166| 59,493| 314,317| 19,535| 534,286| 406,460| 266,54| 26,476| 129,249| 138,439| 355,410| 367,245| 189,12| 198,179| 266,550| 98,103| 205,581| 231,459| 453,33| 204,545| 63,503| 88,399| 350,18| 135,170| 527,126| 91,493| 436,450| 406,267| 276,294| 32,449| 182,361| 599,38| 478,159| 599,456| 301,9| 537,546| 522,574| 292,121| 493,136| 572,538| 311,445| 565,401| 118,102| 280,553| 438,290| 594,180| 599,397| 37,429| 520,442| 598,514| 591,245| 166,591| 388,306| 528,255| 130,242| 336,61| 447,179| 266,506| 204,190| 499,367| 262,421| 213,352| 220,318| 240,16| 215,144| 523,333| 118,44| 200,434| 296,137| 230,499| 28,554| 311,169| 47,371| 191,435| 437,511| 461,41| 5,36| 596,598| 399,186| 232,555| 405,494| 582,447| 495,126| 588,372| 512,347| 262,215| 116,34| 458,277| 118,425| 146,350| 506,383| 146,371| 340,301| 397,403| 437,141| 12,72| 386,222| 283,412| 445,143| 331,117| 35,279| 453,112| 195,215| 47,159| 91,77| 323,408| 280,142| 73,603| 520,146| 239,592| 585,108| 340,91| 539,503| 229,574| 328,364| 96,604| 356,85| 457,336| 549,469| 484,509| 20,403| 210,359| 525,221| 295,251| 395,55| 528,258| 489,32| 150,158| 184,491| 295,11| 353,108| 400,134| 182,570| 570,9| 22,442| 570,346| 280,335| 176,526| 473,199| 27,484| 287,46| 237,502| 578,506| 309,391| 212,129| 569,593| 296,559| 472,346| 133,331| 349,7| 474,591| 343,182| 370,398| 404,262| 187,579| 150,279| 112,384| 314,535| 439,250| 494,383| 147,36| 170,211| 221,339| 84,586| 387,14| 343,289| 602,378| 328,215| 71,103| 577,1| 224,345| 484,173| 442,292| 226,421| 521,76| 541,292| 293,525| 545,129| 50,130| 152,41| 493,525| 112,555| 92,342| 601,34| 48,168| 34,507| 437,41| 282,52| 351,496| 391,279| 371,312| 262,279| 131,321| 304,99| 486,334| 423,26| 219,497| 104,270| 105,592| 352,426| 28,24| 77,81| 519,326| 249,35| 375,491| 497,23| 356,172| 363,99| 15,360| 520,5| 306,570| 355,591| 255,569| 350,539| 245,120| 257,221| 39,117| 150,198| 211,50| 30,140| 222,10| 69,82| 71,403| 273,210| 62,295| 81,594| 207,421| 83,139| 74,284| 596,301| 265,198| 138,465| 322,505| 145,380| 168,202| 154,203| 418,337| 454,158| 484,357| 344,46| 475,193| 379,555| 603,419| 68,427| 566,282| 226,17| 102,371| 190,217| 565,68| 574,47| 188,607| 73,109| 40,573| 322,540|]; order=[|487,1| 277,1| 343,1|];